import styles from './explain.less';
import { history, useIntl } from 'umi';
import { Button, Table } from 'antd';
import request from '@/utils/request';

// rowSelection object indicates the need for row selection
const rowSelection = {
  onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => {
    console.log(
      `selectedRowKeys: ${selectedRowKeys}`,
      'selectedRows: ',
      selectedRows,
    );
  },
  getCheckboxProps: (record: DataType) => ({
    disabled: record.name === 'Disabled User', // Column configuration not to be checked
    name: record.name,
  }),
};

const onCreate = () => {
  history.push('/rosrer/create');
};

const CampaignsPage = function () {
  const intl = useIntl();
  return (
    <div className={styles.CampaignsExplain}>
      <div className={styles.ceTitle}>
        {intl.formatMessage({ id: 'contactsnodata_title' })}
      </div>
      <div className={styles.ceSubTitle}>
        <div>{intl.formatMessage({ id: 'contactsnodata_subtitle1' })}</div>
        <div>{intl.formatMessage({ id: 'contactsnodata_subtitle2' })}</div>
        <div>{intl.formatMessage({ id: 'contactsnodata_subtitle3' })}</div>
      </div>
      <Button type="primary" onClick={onCreate}>
        {intl.formatMessage({ id: 'addchannels' })}
      </Button>
    </div>
  );
};

CampaignsPage.title = '营销群发讯息';

export default CampaignsPage;
